package com.ruoyi.wgjlcData.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.wgjlcData.domain.plat.DataWgjlcZhmhxh;
import com.ruoyi.wgjlcData.mapper.DataWgjlcZhmhxhMapper;
import com.ruoyi.wgjlcData.service.IDataWgjlcZhmhxhService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.concurrent.Future;

/**
 * 无轨胶轮车照明及信号测试项Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-27
 */
@Service
public class DataWgjlcZhmhxhServiceImpl implements IDataWgjlcZhmhxhService
{
    @Autowired
    private DataWgjlcZhmhxhMapper dataWgjlcZhmhxhMapper;

    /**
     * 查询无轨胶轮车照明及信号测试项
     * 
     * @param zhmhxhId 无轨胶轮车照明及信号测试项主键
     * @return 无轨胶轮车照明及信号测试项
     */
    @Override
    public DataWgjlcZhmhxh selectDataWgjlcZhmhxhByZhmhxhId(Long zhmhxhId)
    {
        return dataWgjlcZhmhxhMapper.selectDataWgjlcZhmhxhByZhmhxhId(zhmhxhId);
    }

    /**
     * 查询无轨胶轮车照明及信号测试项列表
     * 
     * @param dataWgjlcZhmhxh 无轨胶轮车照明及信号测试项
     * @return 无轨胶轮车照明及信号测试项
     */
    @Override
    public List<DataWgjlcZhmhxh> selectDataWgjlcZhmhxhList(DataWgjlcZhmhxh dataWgjlcZhmhxh)
    {
        return dataWgjlcZhmhxhMapper.selectDataWgjlcZhmhxhList(dataWgjlcZhmhxh);
    }

    /**
     * 新增无轨胶轮车照明及信号测试项
     * 
     * @param dataWgjlcZhmhxh 无轨胶轮车照明及信号测试项
     * @return 结果
     */
    @Override
    public int insertDataWgjlcZhmhxh(DataWgjlcZhmhxh dataWgjlcZhmhxh)
    {
        dataWgjlcZhmhxh.setCreateTime(DateUtils.getNowDate());
        return dataWgjlcZhmhxhMapper.insertDataWgjlcZhmhxh(dataWgjlcZhmhxh);
    }

    /**
     * 修改无轨胶轮车照明及信号测试项
     * 
     * @param dataWgjlcZhmhxh 无轨胶轮车照明及信号测试项
     * @return 结果
     */
    @Override
    public int updateDataWgjlcZhmhxh(DataWgjlcZhmhxh dataWgjlcZhmhxh)
    {
        dataWgjlcZhmhxh.setUpdateTime(DateUtils.getNowDate());
        return dataWgjlcZhmhxhMapper.updateDataWgjlcZhmhxh(dataWgjlcZhmhxh);
    }

    /**
     * 查询无轨胶轮车-照明及信号测试项
     *
     * @param dataTaskId
     * @return 无轨胶轮车-照明及信号测试项
     */
    @Override
    public Future<List<DataWgjlcZhmhxh>> selectDataWgjlcZhmhxhByDataTaskId(Long dataTaskId) {
        return new AsyncResult<>(dataWgjlcZhmhxhMapper.selectDataWgjlcZhmhxhByDataTaskId(dataTaskId));
    }

    /**
     * 修改状态为2
     *
     * @param dataTaskId
     */
    @Override
    public int updateDataWgjlcZhmhxhByDataTaskId(Long dataTaskId) {
        return dataWgjlcZhmhxhMapper.updateDataWgjlcZhmhxhByDataTaskId(dataTaskId);
    }

    /**
     * 批量新增无轨胶轮车-照明及信号测试项
     *
     * @param dataWgjlcZhmhxh 无轨胶轮车-照明及信号测试项
     * @return 结果
     */
    @Override
    public int batchDataWgjlcZhmhxh(List<DataWgjlcZhmhxh> dataWgjlcZhmhxh) {
        return dataWgjlcZhmhxhMapper.batchDataWgjlcZhmhxh(dataWgjlcZhmhxh);
    }

    /**
     * 批量删除无轨胶轮车照明及信号测试项
     * 
     * @param zhmhxhIds 需要删除的无轨胶轮车照明及信号测试项主键
     * @return 结果
     */
    @Override
    public int deleteDataWgjlcZhmhxhByZhmhxhIds(Long[] zhmhxhIds)
    {
        return dataWgjlcZhmhxhMapper.deleteDataWgjlcZhmhxhByZhmhxhIds(zhmhxhIds);
    }

    /**
     * 删除无轨胶轮车照明及信号测试项信息
     * 
     * @param zhmhxhId 无轨胶轮车照明及信号测试项主键
     * @return 结果
     */
    @Override
    public int deleteDataWgjlcZhmhxhByZhmhxhId(Long zhmhxhId)
    {
        return dataWgjlcZhmhxhMapper.deleteDataWgjlcZhmhxhByZhmhxhId(zhmhxhId);
    }
}
